home *** CD-ROM | disk | FTP | other *** search
- # include "stdio.h"
- # define U(x) ((unsigned char)(x))
- # define NLSTATE yyprevious=YYNEWLINE
- # define BEGIN yybgin = yysvec + 1 +
- # define INITIAL 0
- # define YYLERR yysvec
- # define YYSTATE (yyestate-yysvec-1)
- # define YYOPTIM 1
- # define YYLMAX 200
- # define output(c) (void)putc(c,yyout)
- #if defined(__cplusplus) || defined(__STDC__)
-
- #ifdef __cplusplus
- extern "C" {
- #endif
- int yylex(void);
- int yyback(int *, int);
- int yyinput(void);
- int yylook(void);
- void yyoutput(int);
- int yyracc(int);
- int yyreject(void);
- void yyunput(int);
- #ifndef yyless
- void yyless(int);
- #endif
- #ifndef yywrap
- int yywrap(void);
- #endif
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-
- # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
- # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
- # define yymore() (yymorfg=1)
- # define ECHO (void)fprintf(yyout, "%s",yytext)
- # define REJECT { nstr = yyreject(); goto yyfussy;}
- int yyleng; extern char yytext[];
- int yymorfg;
- extern char *yysptr, yysbuf[];
- int yytchar;
- FILE *yyin = {stdin}, *yyout = {stdout};
- extern int yylineno;
- struct yysvf {
- struct yywork *yystoff;
- struct yysvf *yyother;
- int *yystops;};
- struct yysvf *yyestate;
- extern struct yysvf yysvec[], *yybgin;
- #include "y.tab.h"
- extern int yylval;
- char last_string[81];
- # define YYNEWLINE 10
- yylex(){
- int nstr; extern int yyprevious;
- while((nstr = yylook()) >= 0)
- yyfussy: switch(nstr){
- case 0:
- if(yywrap()) return(0); break;
- case 1:
-
- # line 7 "commands.l"
- return(QUIT);
- break;
- case 2:
-
- # line 8 "commands.l"
- return(LEADIN);
- break;
- case 3:
-
- # line 9 "commands.l"
- return(LEADOUT);
- break;
- case 4:
-
- # line 10 "commands.l"
- return(BOT);
- break;
- case 5:
-
- # line 11 "commands.l"
- return(EOT);
- break;
- case 6:
-
- # line 12 "commands.l"
- return(RATE);
- break;
- case 7:
-
- # line 13 "commands.l"
- return(COPY);
- break;
- case 8:
-
- # line 14 "commands.l"
- return(PROGRAM);
- break;
- case 9:
-
- # line 15 "commands.l"
- return(INDEX);
- break;
- case 10:
-
- # line 16 "commands.l"
- return(PAUSE);
- break;
- case 11:
-
- # line 17 "commands.l"
- return(SILENCE);
- break;
- case 12:
-
- # line 18 "commands.l"
- return(TESTPAT);
- break;
- case 13:
-
- # line 19 "commands.l"
- return(FWRITE);
- break;
- case 14:
-
- # line 20 "commands.l"
- return(FREAD);
- break;
- case 15:
-
- # line 21 "commands.l"
- return(WHERE);
- break;
- case 16:
-
- # line 22 "commands.l"
- return(WHERENOT);
- break;
- case 17:
-
- # line 23 "commands.l"
- return(FRAMES);
- break;
- case 18:
-
- # line 24 "commands.l"
- return(READFRAME);
- break;
- case 19:
-
- # line 25 "commands.l"
- return(SEEK);
- break;
- case 20:
-
- # line 26 "commands.l"
- { yylval = atoi(yytext); return(INTEGER); }
- break;
- case 21:
-
- # line 27 "commands.l"
- { yylval = 1; return(BOOLEAN); }
- break;
- case 22:
-
- # line 28 "commands.l"
- { yylval = 1; return(BOOLEAN); }
- break;
- case 23:
-
- # line 29 "commands.l"
- { yylval = 0; return(BOOLEAN); }
- break;
- case 24:
-
- # line 30 "commands.l"
- { yylval = 0; return(BOOLEAN); }
- break;
- case 25:
-
- # line 31 "commands.l"
- return(PROGNUM);
- break;
- case 26:
-
- # line 32 "commands.l"
- return(ATIME);
- break;
- case 27:
-
- # line 33 "commands.l"
- return(PTIME);
- break;
- case 28:
-
- # line 34 "commands.l"
- return(COLON);
- break;
- case 29:
-
- # line 35 "commands.l"
- {
- strncpy(last_string, yytext, 80);
- last_string[80] = 0;
- return(STRING);
- }
- break;
- case 30:
-
- # line 40 "commands.l"
- return(COMMENT);
- break;
- case -1:
- break;
- default:
- (void)fprintf(yyout,"bad switch yylook %d",nstr);
- } return(0); }
- /* end of yylex */
- int yyvstop[] = {
- 0,
-
- 29,
- 0,
-
- 29,
- -30,
- 0,
-
- 20,
- 29,
- 0,
-
- 28,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 23,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 21,
- 29,
- 0,
-
- 30,
- 0,
-
- -30,
- 0,
-
- 26,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 24,
- 29,
- 0,
-
- 29,
- 0,
-
- 25,
- 29,
- 0,
-
- 29,
- 0,
-
- 27,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 4,
- 29,
- 0,
-
- 5,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 22,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 1,
- 29,
- 0,
-
- 6,
- 29,
- 0,
-
- 14,
- 29,
- 0,
-
- 19,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 9,
- 29,
- 0,
-
- 29,
- 0,
-
- 29,
- 0,
-
- 10,
- 29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4,4, 4,4, 4,4,
- 4,4, 20,42, 24,43, 25,44,
- 4,4, 4,4, 4,22, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,4, 4,4, 4,4,
- 4,4, 4,22, 4,22, 4,22,
- 4,4, 19,40, 26,45, 27,46,
- 28,47, 22,22, 30,48, 22,22,
- 22,22, 22,22, 22,22, 19,41,
- 22,22, 22,22, 22,22, 22,22,
- 32,49, 34,50, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 35,51, 36,52,
- 22,22, 22,22, 22,22, 37,53,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 38,54,
- 39,55, 40,56, 22,22, 22,22,
- 41,57, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 22,22,
- 22,22, 22,22, 22,22, 42,58,
- 45,59, 46,60, 22,22, 47,61,
- 48,62, 49,63, 49,64, 50,65,
- 51,66, 52,67, 53,68, 54,69,
- 55,70, 56,71, 57,72, 59,73,
- 60,74, 61,75, 62,77, 63,78,
- 64,79, 67,80, 69,82, 61,76,
- 70,83, 71,84, 72,85, 73,86,
- 75,87, 76,88, 78,89, 67,81,
- 79,90, 80,91, 81,92, 82,93,
- 83,94, 88,95, 89,96, 90,97,
- 91,98, 92,99, 93,100, 94,101,
- 97,102, 98,103, 103,104, 0,0,
- 0,0};
- struct yysvf yysvec[] = {
- 0, 0, 0,
- yycrank+1, 0, 0,
- yycrank+0, yysvec+1, 0,
- yycrank+93, 0, yyvstop+1,
- yycrank+206, 0, yyvstop+3,
- yycrank+172, yysvec+3, yyvstop+6,
- yycrank+0, 0, yyvstop+9,
- yycrank+68, yysvec+3, yyvstop+11,
- yycrank+45, yysvec+3, yyvstop+13,
- yycrank+74, yysvec+3, yyvstop+15,
- yycrank+72, yysvec+3, yyvstop+17,
- yycrank+42, yysvec+3, yyvstop+19,
- yycrank+50, yysvec+3, yyvstop+21,
- yycrank+78, yysvec+3, yyvstop+23,
- yycrank+120, yysvec+3, yyvstop+26,
- yycrank+101, yysvec+3, yyvstop+28,
- yycrank+134, yysvec+3, yyvstop+30,
- yycrank+132, yysvec+3, yyvstop+32,
- yycrank+131, yysvec+3, yyvstop+34,
- yycrank+229, yysvec+3, yyvstop+36,
- yycrank+196, yysvec+3, yyvstop+38,
- yycrank+0, 0, yyvstop+41,
- yycrank+304, yysvec+4, yyvstop+43,
- yycrank+0, yysvec+3, yyvstop+45,
- yycrank+182, yysvec+3, yyvstop+48,
- yycrank+183, yysvec+3, yyvstop+50,
- yycrank+237, yysvec+3, yyvstop+52,
- yycrank+235, yysvec+3, yyvstop+54,
- yycrank+239, yysvec+3, yyvstop+56,
- yycrank+0, yysvec+3, yyvstop+58,
- yycrank+221, yysvec+3, yyvstop+61,
- yycrank+0, yysvec+3, yyvstop+63,
- yycrank+237, yysvec+3, yyvstop+66,
- yycrank+0, yysvec+3, yyvstop+68,
- yycrank+244, yysvec+3, yyvstop+71,
- yycrank+246, yysvec+3, yyvstop+73,
- yycrank+266, yysvec+3, yyvstop+75,
- yycrank+266, yysvec+3, yyvstop+77,
- yycrank+287, yysvec+3, yyvstop+79,
- yycrank+281, yysvec+3, yyvstop+81,
- yycrank+296, yysvec+3, yyvstop+83,
- yycrank+295, yysvec+3, yyvstop+85,
- yycrank+312, yysvec+3, yyvstop+87,
- yycrank+0, yysvec+3, yyvstop+89,
- yycrank+0, yysvec+3, yyvstop+92,
- yycrank+319, yysvec+3, yyvstop+95,
- yycrank+328, yysvec+3, yyvstop+97,
- yycrank+331, yysvec+3, yyvstop+99,
- yycrank+317, yysvec+3, yyvstop+101,
- yycrank+330, yysvec+3, yyvstop+103,
- yycrank+319, yysvec+3, yyvstop+105,
- yycrank+335, yysvec+3, yyvstop+107,
- yycrank+337, yysvec+3, yyvstop+109,
- yycrank+331, yysvec+3, yyvstop+111,
- yycrank+338, yysvec+3, yyvstop+113,
- yycrank+324, yysvec+3, yyvstop+115,
- yycrank+327, yysvec+3, yyvstop+117,
- yycrank+326, yysvec+3, yyvstop+119,
- yycrank+0, yysvec+3, yyvstop+121,
- yycrank+342, yysvec+3, yyvstop+124,
- yycrank+324, yysvec+3, yyvstop+126,
- yycrank+340, yysvec+3, yyvstop+128,
- yycrank+345, yysvec+3, yyvstop+130,
- yycrank+333, yysvec+3, yyvstop+132,
- yycrank+343, yysvec+3, yyvstop+134,
- yycrank+0, yysvec+3, yyvstop+136,
- yycrank+0, yysvec+3, yyvstop+139,
- yycrank+347, yysvec+3, yyvstop+142,
- yycrank+0, yysvec+3, yyvstop+145,
- yycrank+340, yysvec+3, yyvstop+148,
- yycrank+340, yysvec+3, yyvstop+150,
- yycrank+352, yysvec+3, yyvstop+152,
- yycrank+353, yysvec+3, yyvstop+154,
- yycrank+340, yysvec+3, yyvstop+156,
- yycrank+0, yysvec+3, yyvstop+158,
- yycrank+346, yysvec+3, yyvstop+161,
- yycrank+340, yysvec+3, yyvstop+163,
- yycrank+0, yysvec+3, yyvstop+165,
- yycrank+361, yysvec+3, yyvstop+168,
- yycrank+362, yysvec+3, yyvstop+170,
- yycrank+347, yysvec+3, yyvstop+172,
- yycrank+351, yysvec+3, yyvstop+174,
- yycrank+364, yysvec+3, yyvstop+176,
- yycrank+367, yysvec+3, yyvstop+178,
- yycrank+0, yysvec+3, yyvstop+180,
- yycrank+0, yysvec+3, yyvstop+183,
- yycrank+0, yysvec+3, yyvstop+186,
- yycrank+0, yysvec+3, yyvstop+189,
- yycrank+349, yysvec+3, yyvstop+192,
- yycrank+357, yysvec+3, yyvstop+194,
- yycrank+362, yysvec+3, yyvstop+196,
- yycrank+371, yysvec+3, yyvstop+198,
- yycrank+354, yysvec+3, yyvstop+200,
- yycrank+369, yysvec+3, yyvstop+202,
- yycrank+355, yysvec+3, yyvstop+204,
- yycrank+0, yysvec+3, yyvstop+206,
- yycrank+0, yysvec+3, yyvstop+209,
- yycrank+356, yysvec+3, yyvstop+212,
- yycrank+364, yysvec+3, yyvstop+214,
- yycrank+0, yysvec+3, yyvstop+216,
- yycrank+0, yysvec+3, yyvstop+219,
- yycrank+0, yysvec+3, yyvstop+222,
- yycrank+0, yysvec+3, yyvstop+225,
- yycrank+373, yysvec+3, yyvstop+228,
- yycrank+0, yysvec+3, yyvstop+230,
- 0, 0, 0};
- struct yywork *yytop = yycrank+474;
- struct yysvf *yybgin = yysvec+1;
- unsigned char yymatch[] = {
- 00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 040 ,'!' ,040 ,'!' ,'!' ,'!' ,'!' ,040 ,
- '!' ,'!' ,'!' ,'!' ,040 ,040 ,'!' ,'!' ,
- '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
- '0' ,'0' ,040 ,040 ,'!' ,'!' ,'!' ,040 ,
- '!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,01 ,01 ,01 ,'!' ,'!' ,
- 040 ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,'!' ,
- '!' ,'!' ,'!' ,040 ,040 ,040 ,'!' ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
- 0};
- char yyextra[] = {
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,1,0,
- 0};
- #ident "$Revision: 1.7 $"
-
- int yylineno =1;
- # define YYU(x) x
- # define NLSTATE yyprevious=YYNEWLINE
- char yytext[YYLMAX];
- struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
- char yysbuf[YYLMAX];
- char *yysptr = yysbuf;
- int *yyfnd;
- extern struct yysvf *yyestate;
- int yyprevious = YYNEWLINE;
- #if defined(__cplusplus) || defined(__STDC__)
- int yylook(void)
- #else
- yylook()
- #endif
- {
- register struct yysvf *yystate, **lsp;
- register struct yywork *yyt;
- struct yysvf *yyz;
- int yych, yyfirst;
- struct yywork *yyr;
- # ifdef LEXDEBUG
- int debug;
- # endif
- char *yylastch;
- /* start off machines */
- # ifdef LEXDEBUG
- debug = 0;
- # endif
- yyfirst=1;
- if (!yymorfg)
- yylastch = yytext;
- else {
- yymorfg=0;
- yylastch = yytext+yyleng;
- }
- for(;;){
- lsp = yylstate;
- yyestate = yystate = yybgin;
- if (yyprevious==YYNEWLINE) yystate++;
- for (;;){
- # ifdef LEXDEBUG
- if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
- # endif
- yyt = yystate->yystoff;
- if(yyt == yycrank && !yyfirst){ /* may not be any transitions */
- yyz = yystate->yyother;
- if(yyz == 0)break;
- if(yyz->yystoff == yycrank)break;
- }
- *yylastch++ = yych = input();
- if(yylastch > &yytext[YYLMAX]) {
- fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
- exit(1);
- }
- yyfirst=0;
- tryagain:
- # ifdef LEXDEBUG
- if(debug){
- fprintf(yyout,"char ");
- allprint(yych);
- putchar('\n');
- }
- # endif
- yyr = yyt;
- if ( (void *)yyt > (void *)yycrank){
- yyt = yyr + yych;
- if (yyt <= yytop && yyt->verify+yysvec == yystate){
- if(yyt->advance+yysvec == YYLERR) /* error transitions */
- {unput(*--yylastch);break;}
- *lsp++ = yystate = yyt->advance+yysvec;
- if(lsp > &yylstate[YYLMAX]) {
- fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
- exit(1);
- }
- goto contin;
- }
- }
- # ifdef YYOPTIM
- else if((void *)yyt < (void *)yycrank) { /* r < yycrank */
- yyt = yyr = yycrank+(yycrank-yyt);
- # ifdef LEXDEBUG
- if(debug)fprintf(yyout,"compressed state\n");
- # endif
- yyt = yyt + yych;
- if(yyt <= yytop && yyt->verify+yysvec == yystate){
- if(yyt->advance+yysvec == YYLERR) /* error transitions */
- {unput(*--yylastch);break;}
- *lsp++ = yystate = yyt->advance+yysvec;
- if(lsp > &yylstate[YYLMAX]) {
- fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
- exit(1);
- }
- goto contin;
- }
- yyt = yyr + YYU(yymatch[yych]);
- # ifdef LEXDEBUG
- if(debug){
- fprintf(yyout,"try fall back character ");
- allprint(YYU(yymatch[yych]));
- putchar('\n');
- }
- # endif
- if(yyt <= yytop && yyt->verify+yysvec == yystate){
- if(yyt->advance+yysvec == YYLERR) /* error transition */
- {unput(*--yylastch);break;}
- *lsp++ = yystate = yyt->advance+yysvec;
- if(lsp > &yylstate[YYLMAX]) {
- fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
- exit(1);
- }
- goto contin;
- }
- }
- if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
- # ifdef LEXDEBUG
- if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
- # endif
- goto tryagain;
- }
- # endif
- else
- {unput(*--yylastch);break;}
- contin:
- # ifdef LEXDEBUG
- if(debug){
- fprintf(yyout,"state %d char ",yystate-yysvec-1);
- allprint(yych);
- putchar('\n');
- }
- # endif
- ;
- }
- # ifdef LEXDEBUG
- if(debug){
- fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
- allprint(yych);
- putchar('\n');
- }
- # endif
- while (lsp-- > yylstate){
- *yylastch-- = 0;
- if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
- yyolsp = lsp;
- if(yyextra[*yyfnd]){ /* must backup */
- while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
- lsp--;
- unput(*yylastch--);
- }
- }
- yyprevious = YYU(*yylastch);
- yylsp = lsp;
- yyleng = yylastch-yytext+1;
- yytext[yyleng] = 0;
- # ifdef LEXDEBUG
- if(debug){
- fprintf(yyout,"\nmatch ");
- sprint(yytext);
- fprintf(yyout," action %d\n",*yyfnd);
- }
- # endif
- return(*yyfnd++);
- }
- unput(*yylastch);
- }
- if (yytext[0] == 0 /* && feof(yyin) */)
- {
- yysptr=yysbuf;
- return(0);
- }
- yyprevious = yytext[0] = input();
- if (yyprevious>0)
- output(yyprevious);
- yylastch=yytext;
- # ifdef LEXDEBUG
- if(debug)putchar('\n');
- # endif
- }
- }
- #if defined(__cplusplus) || defined(__STDC__)
- int yyback(int *p, int m)
- #else
- yyback(p, m)
- int *p;
- #endif
- {
- if (p==0) return(0);
- while (*p) {
- if (*p++ == m)
- return(1);
- }
- return(0);
- }
- /* the following are only used in the lex library */
- #if defined(__cplusplus) || defined(__STDC__)
- int yyinput(void)
- #else
- yyinput()
- #endif
- {
- return(input());
- }
- #if defined(__cplusplus) || defined(__STDC__)
- void yyoutput(int c)
- #else
- yyoutput(c)
- int c;
- #endif
- {
- output(c);
- }
- #if defined(__cplusplus) || defined(__STDC__)
- void yyunput(int c)
- #else
- yyunput(c)
- int c;
- #endif
- {
- unput(c);
- }
-